var info_yes = {
    vueInfo: null,
    URL: {
        comfirmSaveInfoUrl: "/api/userInfo/comfirmSaveInfo",
    },
    detail: {
        getUserInfo: function () {
            $.post(info.URL.getUserInfoUrl, {}, function (data) {
                if (!data.hasError) {
                    info_yes.vueInfo = new Vue({
                        el: "#all",
                        data: {
                            userInfo: data.object,
                        },
                        mounted: function () {
                            winInit();
                            $.pop.load(false, null);
                        },
                        methods: {
                            saveInfo: function () {
                                var vmObj = this;
                                forum.detail.saveUserForum(vmObj);
                            },
                            comfirmInfo:function () {
                                info_yes.detail.comfirmSaveInfo();
                            }
                        },
                        filters: {
                            sexFilter: function (value) {
                                if (value == 1) {
                                    return "男";
                                } else {
                                    return "女";
                                }
                            },
                            levelStr: function (value) {
                                if (value == 1){
                                    return "普通 580";
                                }else if (value == 2){
                                    return "普通 880";
                                }else if (value == 3){
                                    return "VIP 1380";
                                }else if (value == 4){
                                    return "VIP 1680";
                                }
                            },
                            forumNumStr:function (value) {
                                if (value == 1){
                                    return "中国智造，领航全球";
                                }else if (value == 2){
                                    return "电商新视界";
                                }else if (value == 3){
                                    return "玩转采购节";
                                }else {
                                    return "";
                                }
                            },
                            isSingleStr:function (value) {
                                if (value == 0){
                                    return "否";
                                }else if (value == 1){
                                    return "是";
                                }else {
                                    return "";
                                }
                            }
                        }
                    });
                } else {
                    if (data.errType != null) {
                        $.pop.tips(data.error);
                        if (data.errType == "NOSESSION") {
                            setTimeout(function () {
                                window.location.href = data.errUrl;
                                return false;
                            }, 400);
                        }
                    }
                }
            }, "json").error(function (XMLHttpRequest, textStatus, errorThrown) {
                $.pop.load(false, null);
                $.pop.tips("系统繁忙，请稍后" + XMLHttpRequest.status + "," + XMLHttpRequest.readyState + "," + textStatus);
            });
        },
        comfirmSaveInfo: function () {
            $.pop.load(true, "正在提交...");
            $.post(info_yes.URL.comfirmSaveInfoUrl, {}, function (data) {
                $.pop.load(false, null);
                if (!data.hasError) {
                    $.pop.tips("已提交");
                    setTimeout(function () {
                        window.location.href = "index.html";
                        return false;
                    }, 400);
                } else {
                    if (data.errType != null) {
                        $.pop.tips(data.error);
                        if (data.errType == "NOSESSION") {
                            setTimeout(function () {
                                window.location.href = data.errUrl;
                                return false;
                            }, 400);
                        }
                    }
                }
            }, "json").error(function (XMLHttpRequest, textStatus, errorThrown) {
                $.pop.load(false, null);
                $.pop.tips("系统繁忙，请稍后" + XMLHttpRequest.status + "," + XMLHttpRequest.readyState + "," + textStatus);
            });
        }
    }
}